#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "lusb0_usb.h"
#include <QTimer>
namespace Ui {
class MainWindow;
}

#define EP_IN 0x81
class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    void my_usb_get_device_list(void);
    usb_dev_handle * open_dev();
    void printf_device_descriptor(usb_device_descriptor *desc);
    int SetOutputReport(struct usb_dev_handle *handle, unsigned char id, char *data, unsigned char size);
    int hid_write(struct usb_dev_handle *handle, char *data, size_t length);

private slots:
    void on_pushButton_clicked();
    void usbReadTimeout();

private:
    Ui::MainWindow *ui;
    usb_dev_handle *udev;
    struct usb_device *dev;
    QTimer* timer;
};

#endif // MAINWINDOW_H
